package com.zz.source.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zz.source.entity.User;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author chenglei
 * @since 2021-08-15
 */
public interface IUserService extends IService<User> {
    /**
     * @Date: 14:59 2021/8/15
     * @Param: [name, sex]
     * @return: java.util.List<com.zz.source.entity.User>
     * @Description: 根据姓名和性别查询
     **/
    List<User> findNameAndSex(String name, String sex);

    /**
     * @Date: 15:12 2021/8/15
     * @Param: [id, name]
     * @return: int
     * @Description: 根据id修改姓名
     **/
    int updateSetNameAndById(Integer id, String name);


    /**
     * @Date: 15:21 2021/8/15
     * @Param: [id, name, username, sex, age]
     * @return: int
     * @Description: 新增用户
     **/
    int insertUser(Integer id, String name, String username, String sex, Integer age);

    /**
     * @Date: 15:34 2021/8/15
     * @Param: [id]
     * @return: int
     * @Description: 根据id删除用户
     **/
    int deleteById(Integer id);

    /**
     * @Date: 15:40 2021/8/15
     * @Param: []
     * @return: java.util.List<com.zz.source.entity.User>
     * @Description: 查询所有用户的名字的性别
     **/
    List<User> findAllNameAndSex();

    /**
    * @Date: 9:59 2021/8/17
    * @Param: [current, size]
    * @return: com.baomidou.mybatisplus.core.metadata.IPage<com.zz.source.entity.User>
    * @Description: 分页查询
    **/
    IPage<User> findAllByPage(Integer current, Integer size);
}
